package com.zxl.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zxl.common.model.pojo.SysGoods;
import com.zxl.common.model.query.goods.GoodsListQuery;
import com.zxl.common.model.query.goods.SearchQuery;
import com.zxl.common.model.vo.goods.GoodsListVo;
import com.zxl.common.model.vo.goods.SearchGoodsVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品表 Mapper 接口
 * </p>
 *
 * @author zxw
 * @since 2023-03-30
 */
public interface SysGoodsMapper extends BaseMapper<SysGoods> {

    List<GoodsListVo> selectGoodsList(GoodsListQuery goodsListQuery);

    Integer updateCGoodsStatus(@Param("id")Integer id, @Param("status") Integer status);

    List<SearchGoodsVo> search(SearchQuery query);

    void updateStockSales(String goodsCode, Integer goodsNum);

    void cancelStockSales(String goodsCode, Integer goodsNum);

}
